<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style>
		
	</style>
</head>
<body>
	<table cellpadding="5">
		<thead>
		<tr>
			<th>代码</th>
			<th>名称</th>
			<th>涨跌幅</th>
			<th>股价</th>
		</tr>	
		</thead>

		<tfoot></tfoot>

		<tbody>
			<tr>
				<td>603587</td>
				<td>地素</td>
				<td>44.03%</td>
				<td>39.64</td>
			</tr>
			<tr>
				<td>600666</td>
				<td>奥瑞德</td>
				<td>10.14%</td>
				<td>3.80</td>
			</tr>
			<tr>
				<td>002563</td>
				<td>兄弟科技</td>
				<td>10.09%</td>
				<td>6.22</td>
			</tr>
			<tr>
				<td>002563</td>
				<td>圣阳股份</td>
				<td>10.09%</td>
				<td>5.02</td>
			</tr>
			<tr>
				<td>300140</td>
				<td>中环装备</td>
				<td>23.42%</td>
				<td>26.08</td>
			</tr>
			<tr>
				<td>000852</td>
				<td>石化机械</td>
				<td>12.11%</td>
				<td>17.52</td>
			</tr>
		</tbody>
	</table>
</body>
<script>

	var tbody = document.querySelector("tbody");

	var trs = tbody.getElementsByTagName("tr");

	for(var i = 0;i<trs.length;i++){

		if(i%2 == 0){
			trs[i].style = "background-color: pink";
		}else{
			trs[i].style = "background-color: red";
		}

	}
</script>
</html>